import axios from '@/libs/axios1'
let jsonHeaders = {
	'content-type': 'application/json;charset=UTF-8'
}
//断开会话
export const disConnected = (sessionId,data) => {
	return axios({
		url: `/access/sessions/${sessionId}/disConnect`,
		method: 'POST',
		params:data,
		headers: jsonHeaders
	})
}

//获取会话记录
export const getRecord = params => {
	let copy = Object.assign({}, params) // 拷贝一份，不然有影响到页面数据
	if(copy.pageIndex === undefined) {
		copy.pageIndex = copy.page
	}
	if(copy.pageSize === undefined) {
		copy.pageSize = copy.rows
	}
	return axios({
		url: `/access/sessions`,
		method: 'GET',
		headers: jsonHeaders,
		params: copy
	})
}